import request from "@/utils/request";
import { parseStrEmpty } from "@/utils/ruoyi";

const baseUrl = "/api/system/paramsSetting/";

export function getPageApi(query: object) {
  return request({
    url: baseUrl + "page",
    method: "get",
    params: query,
  });
}

export function getDetailApi(id: string) {
  return request({
    url: baseUrl + parseStrEmpty(id),
    method: "get",
  });
}

export function addApi(data: any) {
  return request({
    url: baseUrl,
    method: "post",
    data: data,
  });
}

export function updateApi(data: any) {
  return request({
    url: baseUrl,
    method: "put",
    data: data,
  });
}

export function deleteApi(id: string) {
  return request({
    url: baseUrl + id,
    method: "delete",
  });
}
